11. Add URIMatcher to ContentProvider
Add URIMatcher to ContentProvider
INSTRUCTOR NOTE:
Add this gist to your PetProvider class to get started
Helpful resources:
Example of a URI matcher in an sample ContentProvider (Scroll down to ExampleProvider code snippet)
Add URIMatcher Quiz
QUIZ QUESTION::
Drag the values on the right to the letter that matches the parameter on the left
ANSWER CHOICES:
Parameter |
Value |
---|---|
PetContract.CONTENT_AUTHORITY |
|
PetContract.PATH_PETS |
|
PETS |
|
PET_ID |
|
PetContract.CONTENT_AUTHORITY |
|
PetContract.PATH_PETS + "/#" |
SOLUTION:
Parameter |
Value |
---|---|
PetContract.CONTENT_AUTHORITY |
|
PetContract.CONTENT_AUTHORITY |
|
PetContract.PATH_PETS |
|
PETS |
|
PET_ID |
|
PetContract.CONTENT_AUTHORITY |
|
PetContract.CONTENT_AUTHORITY |
|
PetContract.PATH_PETS + "/#" |
Solution
Add URIMatcher to ContentProvider
INSTRUCTOR NOTE:
Correction: The Solution Video uses the value PETS_ID for the last parameter. It should be PET_ID.